<?php
include("include/config.inc.php");
if(!isset($_SESSION['s_activIdsAdmin']))
{
	header("Location:checkLogin.php");
}
else
{
	$listArray = array();
	$i=0;
	$selectUser = "SELECT name,address,country,phoneNo,email,web,DATE_FORMAT('%d-%m-%Y',dateAndTime)AS dateAndTime
	                 FROM contactus
	                 ORDER BY dateAndTime DESC";
	$selectUserRes = mysql_query($selectUser);
	while($listRow = mysql_fetch_array($selectUserRes))
	{
		$listArray[$i]['name']              = $listRow['name'];
		$listArray[$i]['address']           = $listRow['address'];
		$listArray[$i]['country']           = $listRow['country'];
		$listArray[$i]['phoneNo']           = $listRow['phoneNo'];
		$listArray[$i]['email']             = $listRow['email'];
		$listArray[$i]['web']               = $listRow['web'];
		$listArray[$i]['dateAndTime']       = $listRow['dateAndTime'];
		$i++;
	}
	
	include("bottom.php");
	$smarty->assign('listArray',$listArray);
	$smarty->display("list.tpl");
}
?>